export const selections = [{
  name: '全部',
  id: 'all',
},
{
  name: '今天',
  id: 'today',
},
{
  name: '昨天',
  id: 'yesterday',
},
{
  name: '近七天',
  id: 'week',
},
{
  name: '近一个月',
  id: 'month',
},
{
  name: '自定义',
  id: 'custom',
},
];
export const yTSDay = [{
  name: '前七天',
  id: 'week',
},
{
  name: '昨天',
  id: 'yesterday',
},
{
  name: '今天',
  id: 'today',
},
{
  name: '自定义',
  id: 'custom',
},
];
export const backUp = [
  { name: "今天", id: "today" },
  { name: "明天", id: "tomorrow" },
  { name: "后7天", id: "afterWeek" },
  { name: "自定义", id: "custom" },
];
export const schedulingPlan = [
  { name: "上周", id: "lastWeek" },
  { name: "本周", id: "thisWeek" },
  { name: "下周", id: "nextWeek" },
  { name: "自定义", id: "custom" },
];
export const all = [
  { name: '全部', id: 'all' },
  { name: '自定义', id: 'custom' },
];
export const reports = [
  { name: '昨天', id: 'yesterday' },
  { name: '自定义', id: 'custom' },
];
// 默认筛选条件-今天
export const getDates = function(dates) {
  if (!dates) {
    const date = new Date();
    const year = date.getFullYear();
    const month = date.getMonth() + 1;
    const day = date.getDate();
    const beginTime = year + "-" + month + "-" + day + " 00:00:00";
    const endTime = year + "-" + month + "-" + day + " 23:59:59";
    dates = beginTime + "_" + endTime;
    return dates;
  }
};

// var qs = require('qs');
// 当前宿主平台
export const HOST_PLATFORM = 'WEB';
// 这个就不多说了
export const NODE_ENV = process.env.NODE_ENV || 'prod';

// 是否强制所有请求访问本地 MOCK，看到这里同学不难猜到，每个请求也可以单独控制是否请求 MOCK
export const AJAX_LOCALLY_ENABLE = false;
// 是否开启监控
export const MONITOR_ENABLE = true;
// 路由默认配置，路由表并不从此注入
export const ROUTER_DEFAULT_CONFIG = {
  waitForData: true,
  transitionOnLoad: true,
};
import { getAppId, getToken } from '@monkey.do/monkey';

// axios 默认配置
export const AXIOS_DEFAULT_CONFIG = {
  timeout: 30 * 60 * 1000,
  maxContentLength: 20000000,
  headers: {
    'Content-Type': 'application/json;charset=UTF-8',
    'App-Id': getAppId(),
    'Authorization': 'Bearer' + getToken(),
    // 'Content-Type': 'application/json'
  },
  responseType: 'json',
  // 请求传递的参数需要进行转换
  // transformRequest: [function (data) {
  //   if (data) {
  //     data = qs.stringify(data, {
  //       arrayFormat: 'repeat',
  //     });
  //   }
  //   return data;
  // }],
};

// vuex 默认配置
export const VUEX_DEFAULT_CONFIG = {
  strict: process.env.NODE_ENV !== 'production',
};

// API 默认配置
export const API_DEFAULT_CONFIG = {
  // mockBaseURL: 'http://mock.eolinker.com/CKcItcqec9d15a30ce35b9b10ccc5c2032e1643ae169713?uri=',
  mock: false,
  debug: false,
  // baseURL: 'http://172.20.10.5:8381', // 服务器地址
  // eslint-disable-next-line
  baseURL: GLOBAL.BASEURL, // 服务器地址
  // baseURL: 'http://218.201.47.150:10071', // test
  sep: '/',
};

// CONST 默认配置
export const CONST_DEFAULT_CONFIG = {
  sep: '/',
};

// 还有一些业务相关的配置
// ...

// 还有一些方便开发的配置
export const DEBUG_VUE_DEVTOOLS = true; // vue devtools 开关
export const DEBUG_VUE_DEBUG = true; // vue debug 开关
export const DEBUG_VUE_TIP = true; // vue tip 开关

export const CONSOLE_REQUEST_ENABLE = true;
// 开启请求参数打印
export const CONSOLE_RESPONSE_ENABLE = true;
// 开启响应参数打印
export const CONSOLE_MONITOR_ENABLE = true;
// 监控记录打印
